{# This template is for viewing objects inside a repository. #}
{% load djacket_filters %}

{% if objects %}
    <p class="repo-message">
        <i class="fa fa-quote-left"></i> {{ repo_lsmsg }} <i class="fa fa-quote-right"></i>
    </p>
    <table id='repo-content'>
        <tbody>
            {% if objects.is_blob %}
                <tr class="code-view">
                    <td>
                        <pre>
                            <code><br>{{ objects.show }}</code>
                        </pre>
                    </td>
                </tr>
            {% else %}
                {% for obj in objects %}
                <tr>
                    <td class="repo-obj-name" type="{{obj.get_kind}}">
                        <a data-pjax href="/{{repo_owner}}/{{repo_name}}.git/{{obj.get_kind}}/{{obj.get_revision}}/{{obj.get_path}}">
                            {% if obj.is_tree %}
                            <i class="fa fa-folder"></i>
                            {% elif obj.is_blob %}
                            <i class="obj-icon" ext="{{obj.get_path|obj_ext}}"></i>
                            {% else %}
                            <i class="fa fa-file"></i>
                            {% endif %}
                            {{obj.get_path|obj_name:'/'}}
                        </a>
                    </td>
                    <td class="repo-obj-subject">{{obj.get_subject|ellipsize}}</td>
                    <td class="moment-date repo-obj-commitdate">{{obj.get_committer_date}}</td>
                </tr>
                {% endfor %}
            {% endif %}
        </tbody>
    </table>
    <article class="markdown-preview">
        {% if objects.is_blob %}
        {% else %}
            <h2 class="markdown-title grey-color"></h2>
            <div class="arrow-down"></div>
            <div class="markdown-body">
            </div>
        {% endif %}
    </article>
{% endif %}
